<html dir="ltr" xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:xlink="http://www.w3.org/1999/xlink">
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <meta name="save" content="history" />
    <xml>
      <MSHelp:TOCTitle Title="Index" />
      <MSHelp:RLTitle Title="Index" />
      <MSHelp:Attr Name="DocSet" Value="docSet" />
      <MSHelp:Attr Name="TopicType" Value="kbOrient" />
      <MSHelp:Attr Name="Locale" Value="kbEnglish" />
      <MSHelp:Attr Name="AssetId" Value="{GUID}" />
    </xml>
    <title>Index</title>
    <link rel="stylesheet" type="text/css" href="../local/Classic.css" />
    <script src="../local/EventUtilities.js" type="text/javascript" language="jscript"> </script>
    <script src="../local/SplitScreen.js" type="text/javascript" language="jscript"> </script>
    <script src="../local/Dropdown.js" type="text/javascript" language="jscript"> </script>
    <script src="../local/script.js" type="text/javascript" language="jscript"> </script>
  </head>
  <body>
    <input type="hidden" id="userDataCache" class="userDataStyle" />
    <input type="hidden" id="hiddenScrollOffset" />
    <img id="dropDownImage" style="display:none; height:0; width:0;" alt="DropDown image" src="../local/drpdown.gif" />
    <img id="dropDownHoverImage" style="display:none; height:0; width:0;" alt="DropDownHover image" src="../local/drpdown_orange.gif" />
    <img id="collapseImage" style="display:none; height:0; width:0;" alt="Collapse image" src="../local/collapse_all.gif" />
    <img id="expandImage" style="display:none; height:0; width:0;" alt="Expand image" src="../local/expand_all.gif" />
    <img id="collapseAllImage" style="display:none; height:0; width:0;" alt="CollapseAll image" src="../local/collall.gif" />
    <img id="expandAllImage" style="display:none; height:0; width:0;" alt="ExpandAll image" src="../local/expall.gif" />
    <img id="copyImage" style="display:none; height:0; width:0;" alt="Copy image" src="../local/copycode.gif" />
    <img id="copyHoverImage" style="display:none; height:0; width:0;" alt="CopyHover image" src="../local/copycodeHighlight.gif" />
    <div id="header">
      <table width="100%" id="topTable">
        <tr id="headerTableRow1">
          <td align="left">
            <span id="runningHeaderText">Custom Title</span>
          </td>
        </tr>
        <tr id="headerTableRow2">
          <td align="left">
            <span id="nsrTitle">Index</span>
          </td>
        </tr>
        <tr id="headerTableRow3">
          <td />
        </tr>
      </table>
      <table width="100%" id="bottomTable" cellspacing="0" cellpadding="0">
        <tr>
          <td>
            <span onclick="ExpandCollapseAll(toggleAllImage)" onkeypress="ExpandCollapseAll_CheckKey(toggleAllImage)" tabindex="0" style="cursor:default;display:none;">
              <img id="toggleAllImage" class="toggleAll" alt="CollapseAll image" src="../local/collall.gif" />
              <label id="collapseAllLabel" for="toggleAllImage" style="display: none;">Collapse All</label>
              <label id="expandAllLabel" for="toggleAllImage" style="display: none;">Expand All</label> </span>
            <span id="languageFilterToolTip" onmouseover="languageFilterImage.src=dropDownHoverImage.src;" onmouseout="languageFilterImage.src=dropDownImage.src;" tabindex="0" style="cursor:default;">
              <img id="languageFilterImage" alt="DropDown image" src="../local/drpdown.gif" />
              <label id="showAllLabel" for="languageFilterImage" style="display: none;">Language Filter: All</label>
              <label id="multipleLabel" for="languageFilterImage" style="display: none;">Language Filter: Multiple</label>
              <label id="vbLabel" for="languageFilterImage" style="display: none;">Language Filter: Visual Basic</label>
              <label id="csLabel" for="languageFilterImage" style="display: none;">Language Filter: C#</label>
            </span>
          </td>
        </tr>
      </table>
      <div id="languageSpan">
        <input type="checkbox" name="languageFilter" onclick="SetLanguage(this)" id="vbUsageCheckbox" />
        <label class="languageFilter" for="vbUsageCheckbox">Visual Basic Usage</label>
        <br />
        <input type="checkbox" name="languageFilter" onclick="SetLanguage(this)" id="csCheckbox" />
        <label class="languageFilter" for="csCheckbox">C#</label>
        <br />
      </div>
    </div>
    <div id="mainSection">
      <div id="mainBody">
        <div id="allHistory" class="saveHistory" onsave="saveAll()" onload="loadAll()" />
        <a name="_Toc462569805" href="#">
          <span />
        </a>
        <a name="_GoBack" href="#">
          <span />
        </a>
        <p>
          <img src="images\8b52f348-d854-4a8f-9132-863e0fce5da9.png" />
        </p>
        <br />
        <br />
        <br />
        <h4 class="subheading">WebMatrix Helpers</h4>
        <h1 class="heading">PayPal Helper</h1>
        <br />
        <br />
        <br />
        <h2 class="subheading">Contents</h2>
        <p>
          <a href="docSet_default.html#_Toc279155864">Introduction</a>
        </p>
        <p>
          <a href="docSet_default.html#_Toc279155865">Getting Started in 60 Seconds</a>
        </p>
        <p>
          <a href="docSet_default.html#_Toc279155866">More info</a>
        </p>
        <p>
          <a href="docSet_default.html#_Toc279155867">Helper Reference</a>
        </p>
        <br />
        <a name="_Toc279155864" href="#">
          <span />
        </a>
        <h3 class="subheading">Introduction</h3>
        <a name="_Toc168302996" href="#">
          <span />
        </a>
        <a name="_Toc168399728" href="#">
          <span />
        </a>
        <p>Microsoft WebMatrix provides an easy way to get started with web development, and together with new Razor syntax for ASP.NET Web Pages it includes everything you need to get your web site up, running and integrated with many other sites and networks, in a short period of time. The WebMatrix helpers are designed to make your life easier when creating web sites. They provide you a simple and consistent way of performing common web development tasks that otherwise would require a great deal of custom coding. With a few lines of code you should be able to secure your web site using membership, store information in Windows Azure Storage, integrate your site with Facebook, among others things.</p>
        <p>The PayPal helper allows you to integrate PayPal payments within your WebMatrix website or e-commerce application. With a few lines of code, you’ll enable your Web site customers to click on a payment button to pay for their purchases with their PayPal accounts.</p>
        <p>The helper supports both the PayPal <a href="https://www.x.com/community/ppx/button_manager">Button Manager API</a> and the <a href="https://www.x.com/community/ppx/adaptive_payments">Adaptive Payments API</a>. Using the Button Manager API you will be able to create (and manage) PayPal buttons like <i>Add To Cart</i> or <i>Buy Now</i>, that will let your customers purchase single or multiple items, among other things. With the Adaptive Payments API, you can process from your WebMatrix web site PayPal transactions, in both simple and complex scenarios. You can build Web applications that handle payments, preapprovals for payments, and refunds.</p>
        <br />
        <p>
          <img src="images\19fb5f20-19a2-4d76-a2b0-fd753895da1e.png" />
        </p>
        <a name="_Toc279155865" href="#">
          <span />
        </a>
        <h3 class="subheading">Getting Started in 60 Seconds</h3>
        <p>The helper consists mainly of a <b>PayPal.dll</b> library, among other supporting libraries (paypal_base.dll, log4net.dll), located into the <b>Bin</b> folder of your WebMatrix site. To use the PayPal helper against the PayPal Sandbox follow these steps (the PayPal sandbox allows you to perform operations without real money exchange):</p>
        <ol>
          <li>If you do not already have one, create an account in <a href="https://developer.paypal.com/">PayPal Sandbox Test Environment</a>.</li>
          <li>Once logged into the Sandbox, enter the <b>API Credentials </b>section and make note of the following values:<ol><li>API Username</li><li>API Password</li><li>Signature</li></ol></li>
          <p>
            <img src="images\45d9257f-f452-491c-a16e-20d3cd1370db.png" />
          </p>
          <br />
          <li>Enter the <b>Test Accounts</b> section and create a PayPal Business account (to represent a seller) on the PayPal Sandbox. To do this, you can follow the instructions from this <a href="https://www.x.com/docs/DOC-1379">PayPal Documentation page</a>. Make note of the <b>Login e-mail</b> of the new Business account.</li>
          <li>Add the following lines to the <b>_AppStart.cshtml</b> page of your WebMatrix site (you’ll have to create if it doesn’t exist) to initialize the Managed Buttons and Adaptive Payments APIs of the PayPal Helper. Replace the placeholders with your PayPal API credentials.<div class="code"><span codeLanguage="other"><table width="100%" cellspacing="0" cellpadding="0"><tr><th>Razor</th><th><span class="copyCode" onclick="CopyCode(this)" onkeypress="CopyCode_CheckKey(this)" onmouseover="ChangeCopyCodeIcon(this)" onfocusin="ChangeCopyCodeIcon(this)" onmouseout="ChangeCopyCodeIcon(this)" onfocusout="ChangeCopyCodeIcon(this)" tabindex="0"><img class="copyCodeImage" name="ccImage" align="absmiddle" src="../local/copycode.gif" />Copy Code
                  </span></th></tr><tr><td colspan="2"><pre>@{    PayPal.Profile.Initialize(            "{yourAPIUsername}",            "{yourAPIPassword}",            "{yourSignature}",            "sandbox");    // General Adaptive Payments’ properties    PayPal.Profile.Language = "en_US";    PayPal.Profile.CancelUrl = "http://www.mystore.com/ohtoobad.cshtml";    PayPal.Profile.ReturnUrl = "http://www.mystore.com/thanks.cshtml";    PayPal.Profile.IpnUrl = "http://www.mystore.com/notifications.cshtml";    PayPal.Profile.CurrencyCode = "USD";}</pre></td></tr></table></span></div><br /></li>
          <li>Add the highlighted lines from below in the page where you want to show a <b>PayPal Add To Cart</b> button. The "<i>{sellerEmail}</i>" placeholder should be changed by the e-mail of the seller account you’ve configured previously. <b>Notice that this code is for sample purposes only and will create a PayPal button each time the page is rendered</b>; on your implementation you can store the button’s <i>WebSiteCode</i> value in a database.<div class="code"><span codeLanguage="other"><table width="100%" cellspacing="0" cellpadding="0"><tr><th>Razor</th><th><span class="copyCode" onclick="CopyCode(this)" onkeypress="CopyCode_CheckKey(this)" onmouseover="ChangeCopyCodeIcon(this)" onfocusin="ChangeCopyCodeIcon(this)" onmouseout="ChangeCopyCodeIcon(this)" onfocusout="ChangeCopyCodeIcon(this)" tabindex="0"><img class="copyCodeImage" name="ccImage" align="absmiddle" src="../local/copycode.gif" />Copy Code
                  </span></th></tr><tr><td colspan="2"><pre><b>@{</b><b>    var payPalButton = PayPal.ButtonManager.AddToCartButton.Create(</b><b>                                                business : "{sellerEmail}", </b><b>                                                itemName : "My Product", </b><b>                                                amount : "99.99");</b><b>    HtmlString payPalButtonHtml = new HtmlString(payPalButton.WebSiteCode);</b><b>}</b>&lt;!DOCTYPE html&gt;&lt;html&gt;    &lt;head&gt;        ...    &lt;/head&gt;    &lt;body&gt;        ...<b>        @payPalButtonHtml</b>        ...    &lt;/body&gt;&lt;/html&gt;</pre></td></tr></table></span></div><p>Now, if you login to PayPal (remember to use your Sandbox account if you have been using that) and click the <b>Profile</b> link and then <b>My Saved Buttons</b> under <b>Selling Preferences</b>, you will be able to see the button you have just created.</p></li>
          <li>Now let’s test the Adaptive Payments API, by executing a chained payment. Suppose that you have a list of suppliers that you want to pay whenever an item is sold through your online application. Create a new web page and add the following highlighted code. Replace the “<i>{storeEmail}</i>” and “<i>{supplierEmail}</i>” placeholders with two different PayPal sandbox (or real) accounts.<div class="code"><span codeLanguage="other"><table width="100%" cellspacing="0" cellpadding="0"><tr><th>Razor</th><th><span class="copyCode" onclick="CopyCode(this)" onkeypress="CopyCode_CheckKey(this)" onmouseover="ChangeCopyCodeIcon(this)" onfocusin="ChangeCopyCodeIcon(this)" onmouseout="ChangeCopyCodeIcon(this)" onfocusout="ChangeCopyCodeIcon(this)" tabindex="0"><img class="copyCodeImage" name="ccImage" align="absmiddle" src="../local/copycode.gif" />Copy Code
                  </span></th></tr><tr><td colspan="2"><pre><b>@{</b><b>    var productPrice = 99.99m;</b><b>    var supplierAmount = decimal.Round(productPrice * .10m, 2);</b><b></b><b>    var MyStore = new PayPal.AdaptivePayments.Receiver();</b><b>    MyStore.amount = productPrice;</b><b>    MyStore.email = "{storeEmail}";</b><b></b><b>    var Suppliers = new List&lt;PayPal.AdaptivePayments.Receiver&gt;();</b><b>    var Supplier = new PayPal.AdaptivePayments.Receiver();</b><b>    Supplier.email = "{supplierEmail}";</b><b>    Supplier.amount = supplierAmount;</b><b>    Suppliers.Add(Supplier);</b><b></b><b>    var response = PayPal.AdaptivePayments.ChainedPay.Execute(MyStore, Suppliers, "", "Test Payment", "127.0.0.1", "MyDevice");</b><b></b><b>    response.Redirect();</b><b>}</b>&lt;!DOCTYPE html&gt;&lt;html&gt;    &lt;head&gt;        ...    &lt;/head&gt;    &lt;body&gt;        ...    &lt;/body&gt;&lt;/html&gt;</pre></td></tr></table></span></div><p>You prepare the payment by setting up a single instance of a “receiver” which is the store that is receiving the payment. After that, you setup a list of receivers, which represents our suppliers (or other people that we need to pay after the transaction); each one will receive 10% of the product price.</p></li>
        </ol>
        <a name="_Toc279155866" href="#">
          <span />
        </a>
        <h3 class="subheading">More info</h3>
        <p>Learn more on WebMatrix, ASP.NET Web Pages and the Razor Syntax with <a href="http://www.microsoft.com/web/webmatrix/learn/">the WebMatrix tutorials</a>.</p>
        <p>PayPal Documentation and Manuals can be found on the <a href="https://www.x.com/community/ppx/documentation">PayPal X Developer Network</a>.</p>
        <a name="_Toc279155867" href="#">
          <span />
        </a>
        <h3 class="subheading">Helper Reference</h3>
        <h4 class="subheading">Button Manager API</h4>
        <p>The PayPal Button Manager API support of the PayPal Helper lets you programmatically create, manage, edit, and delete Website Payment Standard buttons, which are the same kind of buttons that you can create from the PayPal Profile. Hosted buttons created by this API reside on PayPal and can use all features, including inventory management.</p>
        <p>You can use the Helper to create the following types of buttons:</p>
        <ul>
          <li>Buy Now: Sell single items in various quantities</li>
          <li>Add to Cart: Sell multiple items at one time</li>
          <li>Donate: Accept monetary contributions</li>
          <li>Subscribe: Sign people up for recurring payments</li>
        </ul>
        <p>All the calls to the Button Manager API, should be preceded by the <b>PayPal.ButtonManager</b> namespace.</p>
        <table style="">
          <tr valign="top">
            <th>
              <p>Method</p>
            </th>
            <th>
              <p>Description</p>
            </th>
          </tr>
          <tr valign="top">
            <td>
              <p>static <b>PayPal.Profile.Initialize</b>(string apiUsername, string apiPassword, string apiSignature, string environment, [string applicationId])</p>
            </td>
            <td>
              <p>Initializes the PayPal both for using the Button Manager API and the Adaptive Payments API Helper. The <b>environment</b> can be ‘sandbox’ or ‘production’. If <b>applicationId</b> is not provided, the helper will use a default testing value provided by PayPal (ONLY for testing purposes).</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static ButtonManegerResponse <b>AddToCartButton.Create</b>(string Business, string ItemName, string Amount)</p>
            </td>
            <td>
              <p>Creates an Add To Cart button for one single item with the minimum number of parameters.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static ButtonManegerResponse <b>AddToCartButton.Create</b>(HtmlButtonVariables buttonVariables, [ButtonOption[] buttonOptions], [string buttonImage], [string buttonImageUrl], [string buttonSubType], [string buttonCountry], [string buttonLanguage])</p>
            </td>
            <td>
              <p>Creates a fully configurable Add To Cart button.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static ButtonManegerResponse <b>AddToCartButton.Update</b>(String hostedButtonId, HtmlButtonVariables buttonVariables, ButtonOption[] buttonOptions)</p>
            </td>
            <td>
              <p>Updates an Add To Cart button.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static void <b>AddToCartButton.Delete</b>(String hostedButtonId)</p>
            </td>
            <td>
              <p>Deletes an Add To Cart button.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static ButtonManegerResponse <b>BuyNowButton.Create</b>(string Business, string ItemName, string Amount)</p>
            </td>
            <td>
              <p>Creates a Buy Now button for one single item with the minimum number of parameters.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static ButtonManegerResponse <b>BuyNowButton.Create</b>(HtmlButtonVariables buttonVariables, [ButtonOption[] buttonOptions], [string buttonImage], [string buttonImageUrl], [string buttonSubType], [string buttonCountry], [string buttonLanguage])</p>
            </td>
            <td>
              <p>Creates a fully configurable Buy Now button.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static ButtonManegerResponse <b>BuyNowButton.Update</b>(String hostedButtonId, HtmlButtonVariables buttonVariables, ButtonOption[] buttonOptions)</p>
            </td>
            <td>
              <p>Updates a Buy Now button.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static void <b>BuyNowButton.Delete</b>(String hostedButtonId)</p>
            </td>
            <td>
              <p>Deletes a Buy Now button.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static ButtonManegerResponse <b>DonateButton.Create</b>(string Business, string ItemName, [string Amount])</p>
            </td>
            <td>
              <p>Creates a Donate button with the minimum number of parameters.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>public static ButtonManegerResponse <b>DonateButton.Create</b>(HtmlButtonVariables buttonVariables, [ButtonOption[] buttonOptions], [string buttonImage], [string buttonImageUrl], [string buttonSubType], [string buttonCountry], [string buttonLanguage])</p>
            </td>
            <td>
              <p>Creates a fully configurable Donate button.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static ButtonManegerResponse <b>DonateButton.Update</b>(String hostedButtonId, HtmlButtonVariables buttonVariables, ButtonOption[] buttonOptions)</p>
            </td>
            <td>
              <p>Updates a Donate button.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static void <b>DonateButton.Delete</b>(String hostedButtonId)</p>
            </td>
            <td>
              <p>Deletes a Donate button.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static ButtonManegerResponse <b>SubscribeButton.Create</b>(string Business, string ItemName, a3, p3, t3)</p>
            </td>
            <td>
              <p>Creates a Subscribe button with the minimum number of parameters.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static ButtonManegerResponse <b>SubscribeButton.Create</b>(HtmlButtonVariables buttonVariables, [ButtonOption[] buttonOptions], [string buttonImage], [string buttonImageUrl], [string buttonSubType], [string buttonCountry], [string buttonLanguage])</p>
            </td>
            <td>
              <p>Creates a fully configurable Subscribe button.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static ButtonManegerResponse <b>SubscribeButton.Update</b>(String hostedButtonId, HtmlButtonVariables buttonVariables, ButtonOption[] buttonOptions)</p>
            </td>
            <td>
              <p>Updates a Subscribe button.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static void <b>SubscribeButton.Delete</b>(String hostedButtonId)</p>
            </td>
            <td>
              <p>Deletes a Subscribe button.</p>
            </td>
          </tr>
        </table>
        <br />
        <table style="">
          <tr valign="top">
            <th>
              <p>Type</p>
            </th>
            <th>
              <p>Description</p>
            </th>
          </tr>
          <tr valign="top">
            <td>
              <p>ButtonManagerResponse</p>
            </td>
            <td>
              <p>After you’ve executed the create button methods, you can retrieve its data from the properties of this object:</p>
              <ul>
                <li><b>WebSiteCode</b>: The button HTML code to render on your Web page.</li>
                <li><b>EmailLink</b>: Code for email links and links in other documents that support external links.</li>
                <li><b>HostedButtonId</b>: The ID of the button.</li>
                <br />
              </ul>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>HtmlButtonVariables</p>
            </td>
            <td>
              <p>Html Button Variables specify information about the product or service for Buy Now and Add to Cart buttons, or they specify information about a contribution for Donate buttons. They also control how PayPal responds when people click the buttons and how they interact with special PayPal features.</p>
              <p>For a complete documentation of the variables you can use to configure the PayPal Buttons see the following link: <a href="https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&amp;content_ID=developer/e_howto_html_Appx_websitestandard_htmlvariables">https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&amp;content_ID=developer/e_howto_html_Appx_websitestandard_htmlvariables</a></p>
              <br />
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>ButtonOptions</p>
            </td>
            <td>
              <p>Using this parameter you can specify different options for the product or service, which will be displayed as a combo box next to the PayPal button. For each option that you crate you should specify a name and a price.</p>
            </td>
          </tr>
        </table>
        <br />
        <p>The following images showcases how you should specify the <b>HtmlButtonVariables</b> and the <b>ButtonOptions </b>in an AddToCart button. This button includes menus specified with the ButtonOptions that allow you to specify the color and size; each color is associated with a specific price.</p>
        <p>
          <img src="images\c3431829-bc93-4403-921f-b35745aedb75.png" />
        </p>
        <p>For more information on the Button Manager API see the following articles:</p>
        <ul>
          <li>Website Payments Standard Button Manager API Overview: <a href="https://www.x.com/docs/DOC-1108">https://www.x.com/docs/DOC-1108</a></li>
          <li>NVP Button Manager API Administration Guide: <a href="https://cms.paypal.com/cms_content/US/en_US/files/developer/PP_WPSButtonMgrAPINVP.pdf">https://cms.paypal.com/cms_content/US/en_US/files/developer/PP_WPSButtonMgrAPINVP.pdf</a></li>
        </ul>
        <h4 class="subheading">Adaptive Payments API</h4>
        <p>PayPal Adaptive Payments API support in the PayPal helper provides several methods, enabling you to build an application that handles payments, preapprovals for payments, and refunds. You can also retrieve Foreign Exchange conversion rates for a list of amounts. Adaptive Payments provides several methods of payment: </p>
        <ul>
          <li><b>Simple Payments</b>: Simple payments enable a sender to send a single payment to a single receiver. This is the traditional way that payments are made. For example, there is the obvious scenario of a one-to-one transaction such as a simple shopping cart application with a single seller.</li>
          <li><b>Parallel Payments</b>: Parallel payments enable a sender to send a single payment to multiple receivers. For example, your application might be a shopping cart that enables a buyer to pay for items from several merchants with one payment. Your shopping cart allocates the payment to merchants that actually provided the items. PayPal then deducts money from the sender’s account and deposits it in the receivers’ accounts.</li>
          <li><b>Chained payments</b>: Chained payments enable a sender to send a single payment to a primary receiver; the primary receiver keeps part of the payment and pays secondary receivers the remainder. For example, your application could be an online travel agency that handles bookings for airfare, hotel reservations, and car rentals. The sender sees only you as the primary receiver. You allocate the payment for your commission and the actual cost of services provided by other receivers. PayPal then deducts money from the sender’s account and deposits it in both your account and the secondary receivers’ accounts.</li>
          <li>Additionally there are three kinds of payment approvals:</li>
          <li><b>Explicit approval payments</b>, in which the sender logs into paypal.com to approve each payment. Explicitly approving payments is the traditional way to pay with PayPal. This method is the only option unless the sender has set up a preapproval agreement or you, the API caller, are also the sender.</li>
          <li><b>Preapproved payments</b>, in which a sender logs into PayPal and sets up preapprovals that approve future payments; for example, for a specific vendor. The sender logs into paypal.com once to set up the preapproval. After the preapproval is set up, payments are are considered approved, and specific approval is unnecessary.</li>
          <li><b>Implicit approval payments</b>, in which your application is both the sender of a payment and the caller of the Adaptive Payments Pay API. In this case, the payment is drawn from your own account, which eliminates the need for approval.</li>
        </ul>
        <p>All the calls to the Adaptive Payments API, should be preceded by the <b>PayPal.AdaptivePayments</b> namespace.</p>
        <br />
        <table style="">
          <tr valign="top">
            <th>
              <p>Property</p>
            </th>
            <th>
              <p>Description</p>
            </th>
          </tr>
          <tr valign="top">
            <td>
              <p>static string <b>PayPal.Profile.Language</b></p>
            </td>
            <td>
              <p>The RFC 3066 language in which error messages are returned; by default it is en_US.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static string <b>PayPal.Profile.CancelUrl</b></p>
            </td>
            <td>
              <p>The URL to which the sender’s browser is redirected if the sender cancels the approval for the payment after logging in to paypal.com to approve the payment. Specify the URL with the HTTP or HTTPS. Maximum length: 1024 characters.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static string <b>PayPal.Profile.ReturnUrl</b></p>
            </td>
            <td>
              <p>The URL to which the sender’s browser is redirected after approving a payment on paypal.com. Specify the URL with the HTTP or HTTPS designator. Maximum length: 1024 characters.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static string <b>PayPal.Profile.IpnUrl</b></p>
            </td>
            <td>
              <p>The URL to which you want all IPN messages for the payments to be sent. Maximum length: 1024 characters.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static string <b>PayPal.Profile.CurrencyCode</b></p>
            </td>
            <td>
              <p>The code of the currency used for the payments. Check the <a href="https://cms.paypal.com/cms_content/US/en_US/files/developer/PP_AdaptivePayments.pdf">Adaptive Payments Guide</a> for a list of supported currency codes.</p>
            </td>
          </tr>
        </table>
        <br />
        <table style="">
          <tr valign="top">
            <th>
              <p>Method</p>
            </th>
            <th>
              <p>Description</p>
            </th>
          </tr>
          <tr valign="top">
            <td>
              <p>static <b>PayPal.Profile.Initialize</b>(string apiUsername, string apiPassword, string apiSignature, string environment, [string applicationId])</p>
            </td>
            <td>
              <p>Initializes the PayPal both for using the Button Manager API and the Adaptive Payments API Helper. The <b>environment</b> can be ‘sandbox’ or ‘production’. If <b>applicationId</b> is not provided, the helper will use a default testing value provided by PayPal (ONLY for testing purposes).</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static PayResponse <b>ChainedPay.Execute</b>(Receiver primaryReceiver,List&lt;Receiver&gt; secondaryReceivers,string senderEmail,string memo,string userIp,string deviceId,[string cancelUrl],[string returnUrl],[string ipnUrl],[string currencyCode],[string language])</p>
            </td>
            <td>
              <p>Executes an explicit chained pay.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static ConvertCurrencyResponse <b>ConvertCurrency.Execute</b>(CurrencyType[] baseAmountList, string[] convertToCurrencyList,[string language])</p>
            </td>
            <td>
              <p>Executes a ConvertCurrency operation to request the current foreign exchange (FX) rate for a specific amount and currency.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static PayResponse <b>ImplicitChainedPay.Execute</b>(Receiver primaryReceiver,List&lt;Receiver&gt; secondaryReceivers,string memo,string userIp,string deviceId,[ipnUrl],[currencyCode],[string language])</p>
            </td>
            <td>
              <p>Executes an implicit chained pay. </p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static PayResponse <b>ImplicitParallelPay.Execute</b>(List&lt;Receiver&gt; receivers, string memo, string userIp, string deviceId,[string ipnUrl],[string currencyCode],[string language])</p>
            </td>
            <td>
              <p>Executes an implicit parallel pay.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static PayResponse <b>ImplicitSimplePay.Execute</b>(string receiverEmail, decimal amount, string memo, string userIp, string deviceId, [string ipnUrl], [string currencyCode], [string language])</p>
            </td>
            <td>
              <p>Executes an implicit simple pay.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static PayResponse <b>ParallelPay.Execute</b>(List&lt;Receiver&gt; receivers, string senderEmail, string memo, string userIp, string deviceId, [string cancelUrl], [string returnUrl], [string ipnUrl], [string currencyCode], [string language])</p>
            </td>
            <td>
              <p>Executes an explicit parallel pay.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static PayResponse <b>PreapprovedChainedPay.Execute</b>(Receiver primaryReceiver,string preapprovalkey,List&lt;Receiver&gt; secondaryReceivers,string senderEmail,string memo,string userIp,string deviceId,[string ipnUrl],[string currencyCode],[string language])</p>
            </td>
            <td>
              <p>Executes a preapproved chained pay.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static PayResponse <b>PreapprovedParallelPay.Execute</b>(List&lt;Receiver&gt; receivers, string preapprovalkey,string senderEmail, string memo, string userIp, string deviceId,[string ipnUrl],[string currencyCode],[string language])</p>
            </td>
            <td>
              <p>Executes a preapproved parallel pay.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static PayResponse <b>PreapprovedSimplePay.Execute</b>(string receiverEmail, decimal amount, string preapprovalKey ,string senderEmail, string memo, string userIp, string deviceId,[string ipnUrl],[string currencyCode],[string language])</p>
            </td>
            <td>
              <p>Executes a preapproved simple pay.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static RefundResponse <b>RefundCompletePayment.Execute</b>(string payKey,string trackingId,[string language])</p>
            </td>
            <td>
              <p>Executes a refund operation to refund an entire payment.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static RefundResponse <b>RefundPartialPayment.Execute</b>(Receiver[] receivers,string payKey,string trackingId,[string currencyCode],[string language])</p>
            </td>
            <td>
              <p>Executes a refund operation to refund a payment to certain specific receivers. In a refund, the terms sender and receiver refer to sender and receivers of the original payment. When making a refund, the sender’s account receives the refund and the receivers’ accounts are the source of the refund. Refunds are made from one or more receivers to a sender.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static RefundResponse <b>RefundTransaction.Execute</b>(string transactionId,[string language])</p>
            </td>
            <td>
              <p>Executes a refund operation to refund a specific transaction.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static PayResponse <b>SimplePay.Execute</b>(string receiverEmail,decimal amount,string senderEmail,string memo,string userIp,string deviceId,[string cancelUrl],[string returnUrl],[string ipnUrl],[string currencyCode],[string language])</p>
            </td>
            <td>
              <p>Executes an explicit simple pay.</p>
            </td>
          </tr>
          <tr valign="top">
            <td>
              <p>static PreapprovalResponse <b>SimplePreapproval.Execute</b>(string senderEmail, DateTime startingDate,decimal maxTotalAmountForAllPayments, decimal maxAmountPerPayment, int maxNumberOfPayments, DateTime endingDate, string memo, string userIp, string deviceId,[string cancelUrl],[string returnUrl],[string ipnUrl],[string currencyCode],[string language])</p>
            </td>
            <td>
              <p>Executes a preapproval operation to set up an agreement between yourself and a sender for making payments on the sender’s behalf. You set up a preapprovals for a specific maximum amount over a specific period of time and, optionally, by any of the following constraints: the number of payments, a maximum per payment amount, for each payment request</p>
            </td>
          </tr>
        </table>
        <br />
        <p>For more information on PayPal Adaptive Payments API see the following articles: </p>
        <ul>
          <li>Adaptive Payments Guide: <a href="https://cms.paypal.com/cms_content/US/en_US/files/developer/PP_AdaptivePayments.pdf">https://cms.paypal.com/cms_content/US/en_US/files/developer/PP_AdaptivePayments.pdf</a></li>
          <li>How To Make a Parallel Payment Using NVP: <a href="https://www.x.com/people/travis/blog/2010/08/12/how-to-make-a-parallel-payment-using-nvp">https://www.x.com/people/travis/blog/2010/08/12/how-to-make-a-parallel-payment-using-nvp</a></li>
          <li>How To Make a Chained Payment Using NVP: <a href="https://www.x.com/people/travis/blog/2010/08/17/how-to-make-a-chained-payment-using-nvp">https://www.x.com/people/travis/blog/2010/08/17/how-to-make-a-chained-payment-using-nvp</a></li>
          <li>3 Types of Adaptive Payments: <a href="https://www.x.com/people/travis/blog/2010/08/11/3-types-of-adaptive-payments">https://www.x.com/people/travis/blog/2010/08/11/3-types-of-adaptive-payments</a><br /></li>
        </ul>
      </div>
      <div id="footer">
        <div class="footerLine">
          <img src="../local/footer.gif" alt="Footer image" width="100%" height="3px" />
        </div>
    To give feedback.
  <p />
    Copyright © 2009 by Microsoft Corporation. All rights reserved.
  </div>
    </div>
  </body>
</html>